#include <algorithm>
#include <cctype> //ctype无法打开，包含tolower()函数和ispunct函数
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <set>
#include <string>
#include <utility> //保存pair的头文件
#include <vector>

using namespace std;

int main(int argc, char **argv) {
  vector<pair<string, int>> vec1(12); //事先定义大小，或者使用push_back()
  ifstream in1("1.txt");
  string str;
  size_t i = 0;
  while (in1 >> str) {
    vec1[i].first = str;
    ++i;
  }
  ifstream in2("2.txt");
  int val;
  size_t j = 0;
  while (in2 >> val) {
    vec1[j].second = val;
    ++j;
  }

  vector<pair<string, int>>::iterator it1 = vec1.begin();
  cout << "vector中元素为：" << endl;
  for (; it1 != vec1.end(); ++it1) {
    cout << it1->first << " " << it1->second << endl;
  }

  return 0;
}